// function updateCartMove(bid) {
//     window.location.href = "/pro05_book_ssm_war_exploded/updateCartMove/" + bid;
// }
//
// function updateCartAdd(bid) {
//     window.location.href = "/pro05_book_ssm_war_exploded/updateCartAdd/" + bid;
// }

window.onload = function () {
    var vue = new Vue({
        el: "#cart_div",
        data: {
            cart:{}
        },
        methods: {
            getCart:function (){
                axios({
                    method: "post",
                    url:"/pro05_book_ssm_war_exploded/cartInfo",
                }).then(function (response){
                    var data = response.data;
                    vue.cart=data.cart
                }).catch(function (reason){
                    alert(reason)
                })
            },
            updateCartMove:function (bid){
                axios({
                    method:"post",
                    url:"/pro05_book_ssm_war_exploded/updateCartMove/" + bid,
                }).then(function (response){
                    vue.getCart()
                })
            },
            updateCartAdd:function (bid){
                axios({
                    method:"post",
                    url:"/pro05_book_ssm_war_exploded/updateCartAdd/" + bid,
                }).then(function (){
                    vue.getCart()
                })
            }
        },
        mounted:function () {
            this.getCart()
        }

    });
}